export const createStore = () => {
  const store = {
    test: '测试',
    from: '北京',
    to: '上海',
    setFrom(to: string) {
      this.from = to;
    },
    setTo(from: string) {
      this.to = from;
    },
    exchangeFromTo() {
      const temp = this.from;
      this.setFrom(this.to);
      this.setTo(temp);
    },
  };
  return store;
};

export type TStore = ReturnType<typeof createStore>;
